﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using HK2009.EntityQuery;

namespace HK2009.BusinessFacade
{
     
    public interface IBNBookingNoteHandler
    {

        /// <summary>
        /// 根据sql语句同参数插入托运单相关表
        /// </summary>
        /// <param name="sqlStr">sql语句</param>
        /// <param name="parms">参数</param>
        /// <returns></returns>
        bool BookingNoteAdd(string sqlStr, SqlParameter[] parms);

        /// <summary>
        /// 根据sql语句同参数获取托运单主表列表
        /// </summary>
        /// <param name="sqlStr">sql语句</param>
        /// <param name="parms">参数</param>
        /// <returns></returns>
        DataTable GetBookingNoteList(string sqlStr, SqlParameter[] parms);

        /// <summary>
        /// 根据sql语句同参数获取托运单详细列表
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="parms"></param>
        /// <returns></returns>
        DataTable GetBookingNoteDetailList(string sqlStr,SqlParameter[] parms);
        
        /// <summary>
        /// 根据PKID获取bookingnote的信息
        /// </summary>
        /// <returns></returns>
        BN_BookingNoteQuery GetBookingNoteByPKID(int id);

        ///// <summary>
        ///// 根据bookingnote id 获取bookingnotedetail的信息
        ///// </summary>
        ///// <param name="bookingNoteID"></param>
        ///// <returns></returns>
        //DataTable GetBookingNoteDetailByBookNoteID(int bookingNoteID);

        /// <summary>
        /// 根据detail　id获取bookingnotedetail信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        BN_BookingNoteDtlQuery GetBookingNoteDetailByID(int id);

        /// <summary>
        /// 根据sql语句同参数更新主托运单表信息
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="parms"></param>
        /// <returns></returns>
        bool BookingNoteUpdate(string sqlStr,SqlParameter[] parms);

        /// <summary>
        /// 根据sql语句同参数增删改托运单表详细信息
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="parms"></param>
        /// <returns></returns>
        bool BookingNoteDetailEdit(string sqlStr,SqlParameter[] parms);

        /// <summary>
        /// 根据sql语句同参数增删改托运单表和详细表信息
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="parms"></param>
        /// <returns></returns>
        bool BookingNoteAndDetailEdit(string sqlStr,SqlParameter[] parms);

        /// <summary>
        /// 根据PKID删除托运单详细信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool BookingNoteDetailDelete(int id);

        /// <summary>
        /// 根据BookingNoteID更新主表和从表的状态为0
        /// </summary>
        /// <param name="bookingNoteID"></param>
        /// <returns></returns>
        bool BookingNoteAndDetailUpdateStatus(int bookingNoteID);

         /// <summary>
        /// 根据BookingNoteID获取托运单详细数目
        /// </summary>
        /// <param name="booknoteID"></param>
        /// <returns></returns>
        int GetBookingNoteTotal(int booknoteID);
        
        /// <summary>
        /// 根据BookingNoteID获取托运单详细已完成的数目
        /// </summary>
        /// <param name="booknoteID"></param>
        /// <returns></returns>
        int GetBookingNoteCompleteTotal(int booknoteID);


        DataTable GetBookingNoteDtlByBookingNoteID(int bookingNoteID);
        
       
    }
}
